package com.inwavetech.os.util.field;

import android.view.View;
import android.widget.TextView;

import java.util.Map;

/**
 * Non editable enum field
 */
public class EnumField implements Field {

    private final TextView view;
    private final Map<Enum, String> enumValuesToStringMap;

    public EnumField(TextView view, Map<Enum, String> enumValuesToStringMap) {
        this.view = view;
        this.enumValuesToStringMap = enumValuesToStringMap;
    }

    @Override
    public boolean isValid() {
        return false;
    }

    @Override
    public Enum getValue() {
        return null;
    }

    @Override
    public void setValue(Object value) {
        view.setText(enumValuesToStringMap.get(value));
    }
}
